package com.linkedbear.springboot.assemble.b_profile;

import com.linkedbear.springboot.assemble.b_profile.config.ProfileTavernConfiguration;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.stream.Stream;

public class TavernProfileApplication {
    
    public static void main(String[] args) throws Exception {
//        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ProfileTavernConfiguration.class);
        // 为ApplicationContext的环境设置正在激活的Profile
//        ctx.getEnvironment().setActiveProfiles("city");
//        ctx.register(ProfileTavernConfiguration.class);
//        ctx.refresh();
        Stream.of(ctx.getBeanDefinitionNames()).forEach(System.out::println);

    }
}
